.class public Lrexsee/keyboard/RexseeKeyboard;
.super Ljava/lang/Object;
.source "RexseeKeyboard.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final EVENT_ONKEYBOADDISMISSED:Ljava/lang/String; = "onKeyboardDismissed"

.field public static final EVENT_ONKEYBOADKEYDOWN:Ljava/lang/String; = "onKeyboardKeyDown"

.field public static final EVENT_ONKEYBOADKEYUP:Ljava/lang/String; = "onKeyboardKeyUp"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "Keyboard"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;

.field private final mMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lrexsee/keyboard/KeyboardDialog;",
            ">;"
        }
    .end annotation
.end field

.field private syncTag:Z


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 40
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 37
    const/4 v0, 0x0

    iput-boolean v0, p0, Lrexsee/keyboard/RexseeKeyboard;->syncTag:Z

    .line 41
    iput-object p1, p0, Lrexsee/keyboard/RexseeKeyboard;->mBrowser:Lrexsee/core/browser/Browser;

    .line 42
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mContext:Landroid/content/Context;

    .line 43
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    .line 44
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onKeyboardKeyDown"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 45
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onKeyboardKeyUp"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 46
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onKeyboardDismissed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 47
    return-void
.end method

.method static synthetic access$0(Lrexsee/keyboard/RexseeKeyboard;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 34
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/keyboard/RexseeKeyboard;)Ljava/util/HashMap;
    .locals 1

    .prologue
    .line 36
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    return-object v0
.end method

.method static synthetic access$2(Lrexsee/keyboard/RexseeKeyboard;Z)V
    .locals 0

    .prologue
    .line 37
    iput-boolean p1, p0, Lrexsee/keyboard/RexseeKeyboard;->syncTag:Z

    return-void
.end method


# virtual methods
.method public dismiss(Ljava/lang/String;)V
    .locals 2
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 87
    iget-object v1, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 91
    :goto_0
    return-void

    .line 88
    :cond_0
    iget-object v1, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lrexsee/keyboard/KeyboardDialog;

    .line 89
    .local v0, "dialog":Lrexsee/keyboard/KeyboardDialog;
    if-eqz v0, :cond_1

    invoke-virtual {v0}, Lrexsee/keyboard/KeyboardDialog;->dismiss()V

    .line 90
    :cond_1
    iget-object v1, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0
.end method

.method public dismissAll()V
    .locals 5

    .prologue
    .line 93
    iget-object v4, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v3

    .line 94
    .local v3, "keys":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 95
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/lang/String;>;"
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_1

    .line 100
    iget-object v4, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4}, Ljava/util/HashMap;->clear()V

    .line 101
    return-void

    .line 96
    :cond_1
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 97
    .local v2, "key":Ljava/lang/String;
    iget-object v4, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v4, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lrexsee/keyboard/KeyboardDialog;

    .line 98
    .local v0, "dialog":Lrexsee/keyboard/KeyboardDialog;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lrexsee/keyboard/KeyboardDialog;->dismiss()V

    goto :goto_0
.end method

.method public exists(Ljava/lang/String;)Z
    .locals 1
    .param p1, "id"    # Ljava/lang/String;

    .prologue
    .line 111
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public getIds()Ljava/lang/String;
    .locals 6

    .prologue
    const-string v5, "\""

    .line 117
    const-string v2, ""

    .line 118
    .local v2, "rtn":Ljava/lang/String;
    iget-object v3, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    .line 119
    .local v0, "ids":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 120
    .end local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    .local v1, "iterator":Ljava/util/Iterator;, "Ljava/util/Iterator<Ljava/lang/String;>;"
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_0

    .line 124
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "["

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "]"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    return-object v3

    .line 121
    :cond_0
    const-string v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ","

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 122
    :cond_1
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, "\""

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Ljava/lang/String;

    invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\""

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    goto :goto_0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 22
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 18
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/keyboard/RexseeKeyboard;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Keyboard"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 26
    new-instance v0, Lrexsee/keyboard/RexseeKeyboard;

    invoke-direct {v0, p1}, Lrexsee/keyboard/RexseeKeyboard;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public getStyle(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "name"    # Ljava/lang/String;

    .prologue
    .line 108
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, ""

    .end local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    :goto_0
    return-object v0

    .restart local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    :cond_0
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    check-cast p0, Lrexsee/keyboard/KeyboardDialog;

    invoke-virtual {p0, p2}, Lrexsee/keyboard/KeyboardDialog;->getStyle(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public setStyle(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;

    .prologue
    .line 104
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 106
    .end local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    :goto_0
    return-void

    .line 105
    .restart local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    :cond_0
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "this":Lrexsee/keyboard/RexseeKeyboard;
    check-cast p0, Lrexsee/keyboard/KeyboardDialog;

    invoke-virtual {p0, p2}, Lrexsee/keyboard/KeyboardDialog;->setStyle(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 10
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;
    .param p3, "keysString"    # Ljava/lang/String;
    .param p4, "theme"    # Ljava/lang/String;

    .prologue
    const-string v5, ""

    .line 51
    const-string v0, ""

    const-string v0, ""

    const-string v0, ""

    const-string v0, ""

    const/4 v9, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v6, v5

    move-object v7, v5

    move-object v8, v5

    invoke-virtual/range {v0 .. v9}, Lrexsee/keyboard/RexseeKeyboard;->show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 52
    return-void
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V
    .locals 8
    .param p1, "id"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;
    .param p3, "keysString"    # Ljava/lang/String;
    .param p4, "theme"    # Ljava/lang/String;
    .param p5, "boardStyle"    # Ljava/lang/String;
    .param p6, "rowStyle"    # Ljava/lang/String;
    .param p7, "normalStyle"    # Ljava/lang/String;
    .param p8, "pressedStyle"    # Ljava/lang/String;
    .param p9, "callback"    # Z

    .prologue
    .line 54
    iget-object v1, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v1, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {p0, p1}, Lrexsee/keyboard/RexseeKeyboard;->dismiss(Ljava/lang/String;)V

    .line 55
    :cond_0
    new-instance v0, Lrexsee/keyboard/KeyboardParameters;

    move-object v1, p3

    move-object v2, p4

    move-object v3, p5

    move-object v4, p6

    move-object v5, p7

    move-object/from16 v6, p8

    move/from16 v7, p9

    invoke-direct/range {v0 .. v7}, Lrexsee/keyboard/KeyboardParameters;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 56
    .local v0, "para":Lrexsee/keyboard/KeyboardParameters;
    const/4 v1, 0x0

    iput-boolean v1, p0, Lrexsee/keyboard/RexseeKeyboard;->syncTag:Z

    .line 57
    iget-object p3, p0, Lrexsee/keyboard/RexseeKeyboard;->mContext:Landroid/content/Context;

    .end local p3    # "keysString":Ljava/lang/String;
    check-cast p3, Landroid/app/Activity;

    new-instance v1, Lrexsee/keyboard/RexseeKeyboard$1;

    invoke-direct {v1, p0, p1, p2, v0}, Lrexsee/keyboard/RexseeKeyboard$1;-><init>(Lrexsee/keyboard/RexseeKeyboard;Ljava/lang/String;Ljava/lang/String;Lrexsee/keyboard/KeyboardParameters;)V

    invoke-virtual {p3, v1}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 77
    :goto_0
    iget-boolean v1, p0, Lrexsee/keyboard/RexseeKeyboard;->syncTag:Z

    if-eqz v1, :cond_1

    .line 84
    return-void

    .line 79
    :cond_1
    const-wide/16 v1, 0x64

    :try_start_0
    invoke-static {v1, v2}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 80
    :catch_0
    move-exception v1

    goto :goto_0
.end method

.method public size()I
    .locals 1

    .prologue
    .line 114
    iget-object v0, p0, Lrexsee/keyboard/RexseeKeyboard;->mMap:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->size()I

    move-result v0

    return v0
.end method
